﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HtmlAgilityPack;

namespace WindowsFormsApplication18
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
            doc.Load(webBrowser1.DocumentStream);
            //HtmlNode someNode = doc.DocumentNode.SelectSingleNode("//*[@id='lbReceipt_i0']");
            //if (someNode != null)
            //{
            //    MessageBox.Show("test");
            //}
            var liOfTravels = doc.DocumentNode.SelectNodes("//div[@id='myTrips'] //li");
            foreach (HtmlNode item in liOfTravels)
            {
                item.SelectSingleNode("/html/body/form/table/tbody/tr[3]/td/div/table/tbody/tr[2]/td/fieldset/div/table/tbody/tr/td/div/div/ul").InnerText;
            }
        }
    }
}
